package com.ternnetwork.oa.job;

import com.ternnetwork.oa.service.work.EventService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;



/**
 * 
 * 工作日程提醒定时作业
 * @author xuwenfeng
 *
 */
@Slf4j
public class EventRemindJob extends QuartzJobBean {

	@Autowired
	private EventService eventService;

	@Override
	protected void executeInternal(JobExecutionContext context) {

		try {

			JobDataMap data=context.getTrigger().getJobDataMap();

			Long eventId =(Long) data.get("eventId");

			eventService.sendRemind(eventId);

		} catch (Exception e1) {
			log.error("",e1);
		}
		
	}

}